<!DOCTYPE html>
<!--

Monomotapa - A Micro CMS
Copyright (C) 2014, Paul Munday.

PO Box 28228, Portland, OR, USA 97228
paul at paulmunday.net

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero  Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

There should also be a copy of the AGPL in src/license.md that should be
accessible by going to <a href ="/license">/license<a> on this site.
-->
<html>
<head>
<title>{% if title -%}{{title}}{% endif %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="lang" content="es"/>
<meta name="author" content="Rodrigo Garcia Saenz"/>
<meta property="article:publisher" content="https://rmgs.com.bo"/>
<meta property="og:site_name" content="Sitio personal de Rodrigo Garcia Saenz"/>
<!-- meta datos dinamicos -->
{%- for metadato in meta -%}
  <meta {{metadato.tag}}="{{metadato.name}}" content="{{metadato.content}}"/>
{%- endfor -%}
<!-- -->
<link rel="stylesheet" type="text/css" title="oscuro" href="/static/style_rmgss.css">
<link rel="alternate stylesheet" type="text/css" title="claro" href="/static/style_rmgss_claro.css">

<!-- {%- if css -%} -->
<!-- {%- for file in css %} -->
<!--     <link href="{{ url_for('static', filename=file) }}" rel="stylesheet" type="text/css"  /> -->
<!--     {%- endfor -%} -->
<!-- {%- endif %} -->
{% if internal_css %}
  <style type="text/css">
    {{internal_css}}
  </style>
{% endif %}
{%- if hlinks -%}
  {%- for item in hlinks -%}
    <link 
       {%- if item.href %} href="{{item.href}}"{% endif -%}
       {%- if item.rel %} rel="{{item.rel}}"{% endif -%} 
       {%- if item.type %} type="{{item.type}}"{% endif -%}
       {%- if item.media %} type="{{item.media}}"{% endif -%}
       {%- if item.hreflang %} type="{{item.hreflang}}"{% endif -%}
       {%- if item.charset %} type="{{item.charset}}"{% endif -%}
       >
     {% endfor %}
   {%- endif -%}



<link rel="apple-touch-icon" sizes="76x76" href="{{ url_for('static', filename='imgs/favicon/apple-touch-icon.png')}}">

<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='imgs/favicon/favicon-32x32.png')}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='imgs/favicon/favicon-16x16.png')}}">
<link rel="manifest" href="{{ url_for('static', filename='imgs/favicon/site.webmanifest')}}">
<link rel="mask-icon" href="{{ url_for('static', filename='imgs/favicon/safari-pinned-tab.svg')}}" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

{# <link rel="shortcut icon" type="image/png" href="/{{ url_for('static', filename='imgs/favicon.png') }}> #}
</head>

<body onload="loadCssStyle()">

  <div id="wrap">
    <div>
      <p> 
	<a href="/">
	  <img src="/static/imgs/cabecera1.png">
	</a>
	<br>
	<span style="font-size:12px;">
	  <q><b>sitio personal</b> de Rodrigo Garcia Saenz.</q>
	</span>
      </p>
    </div>

    <div class="row">
      
      <!-- <div class="col fifth"> -->
      <!-- Importante dejar este -->
      <!-- </div> -->


      <div class="col fifth">

        <!-- Tabla de contenidos del post -->
        {%- if not exclude_toc -%}
        <div id="side_toc">
          <h3>Índice del post</h3>
          {{ toc|safe }}
        </div>
        {%- endif -%}

	<div id="nav_left">
	  <ul>
	    <dd>
	      <a href="/">
                <img class="leftbaricon"
                     src="/static/imgs/inicio.svg" alt="Inicio / Start" title="Inicio 🏡">
	      </a>
	    </dd>
	    <dd>
	      <a href="/posts">
                <img class="leftbaricon" src="/static/imgs/misc.svg" alt="Posts" title="Posts">
                <br>
                Posts
	      </a>		
	      <ul>
		<dd>
		  <a href="/posts/categorias">
		    <img
                      class="leftbaricon"
                      src="/static/imgs/categorias.svg" alt="Categorías" title="Categorías">
                    <br>
		    Categorías
		  </a>
		</dd>
	      </ul>
	    </dd>
	    <dd>	
	      <a href="/posts/categoria/fotos">
		<img
                  class="leftbaricon"
                  src="/static/imgs/fotos.svg" alt="fotos" title="fotos 🖼">
                <br>
		Fotos
	      </a>
	      <dd>
		<a href="/acerca_de_mi">
		  <img src="/static/imgs/acercade.svg" alt="acerca de mi" title="Acerca de mi">
                  <br>
		  Acerca de mi
		</a>
	      </dd>
	      <dd>	
	        <a href="/contacto">
		  <img
                    class="leftbaricon"
                    src="/static/imgs/contacto.svg" alt="contacto" title="Contacto 📨">
                  <br>
		  Contacto
	        </a>
	        
	      </dd>
              
	  </ul>
	  <ul>
	    <hr>
	    {%- for item in navigation.navigation.values() -%}
	      <li><a href="
			   {%- if item.url -%}{{item.url}}
			   {%- elif item.urlfor -%}
			   {%- if item.urlfor == "source" -%}
		           {{ url_for(item.urlfor, page=navigation.page) }}
		           {%- else -%}
		           {{ url_for(item.urlfor) }}
		           {%- endif -%}
		           {%- else -%}
		           {{ url_for('staticpage', page=item.base) }}
		           {%- endif -%}
		           
		           {%- if item.rel -%}
		           " rel="{{item.rel}} 
			   {%- endif -%}
			   ">{{item.link_text}}</a></li>
	    {% endfor -%}
	  </ul>
	  <p>
	    <a href="/rss" >
	      <img src="/static/imgs/rss.png" width="24" heigth="24">
	      RSS
	    </a>
	  </p>
	</div>

        <!-- consejo del dia -->
	<div id="consejo_del_dia">
	  <b>Consejo del día</b>
	  <hr>
	  {% if contexto %}
	    {{ contexto['consejo']|safe }}
	  {% endif %}
	</div>

	<!-- Noticias Realcionadas si es un post -->
        <div id="noticias_relacionadas">
	  {% if contexto is defined %}
	    {% if contexto['relacionadas'] is defined %}
	      <h3>Posts/Noticias relacionadas</h3>
	      {% for post_relacionado in contexto['relacionadas'] %}
	        <p>
	          <a href="/posts/{{ post_relacionado }}">
	            {{ post_relacionado|n_heading }}
	          </a>
	        </p>
	        <hr>
	      {% endfor %}
	    {% endif %}
	  {% endif %}
        </div>

      </div>


      
      <!-- Contenido -->
      <div class="col fill">
	
	<!-- Cabecera -->
	<div style="margin-bottom: 7px">
	  <form>
	    <input type="submit" onclick="cambiarEstilo('oscuro'); return false;" name="theme" value="☻" id="oscuro" style="background-color: #333933; color: #C3C4C2; border-radius:3px;">
	    
	    <input type="submit" onclick="cambiarEstilo('claro'); return false;" name="theme" value="☺" id="claro" style="background-color: #D1E9D3; color: #131914; border-radius:3px;">
	  </form> 
	</div>

	<!-- Contenido -->
	{% block content %}{% endblock %}
        
        <!-- nav bottom (para pantallas chicas) -->
        <div id="nav_bottom">
	  <ul>
	    <dd>
	      <a href="/">
                <img src="/static/imgs/inicio.svg"
                     class="leftbaricon"
                     title="Inicio 🏡"
                     alt="Inicio">
	      </a>
	    </dd>
	    <dd>
	      <a href="/posts">
                <img
                  class="leftbaricon"
                  title="Posts"
                  src="/static/imgs/misc.svg" alt="posts">
                Posts
	      </a>		
	      <ul>
	        <dd>
		  <a href="/posts/categorias">
		    <img
                      class="leftbaricon"
                      title="Categorías"
                      src="/static/imgs/categorias.svg" alt="categorías">
                    categorías
		  </a>
	        </dd>
	      </ul>
	    </dd>
	    <dd>
	      <a href="/posts/categoria/fotos">
		<img
                  class="leftbaricon"
                  title="Fotos 🖼"
                  src="/static/imgs/fotos.svg" alt="fotos">
                fotos
	      </a>

	    </dd>

	    <dd>
	      <a href="/acerca_de_mi">
		<img
                  class="leftbaricon"
                  title="Acerca de mi"
                  src="/static/imgs/acercade.svg" alt="Acerca de mi">
                acerca de
	      </a>
	    </dd>
	  </ul>

	  <dd>	
	    <a href="/contacto">
	      <img
                class="leftbaricon"
                title="Contacto 📨"
                src="/static/imgs/contacto.svg" alt="Contacto">
              contacto
	    </a>
	  </dd>
	  </ul>
	  <ul>
	    <hr>
	    {%- for item in navigation.navigation.values() -%}
	    <li><a href="
		         {%- if item.url -%}{{item.url}}
		         {%- elif item.urlfor -%}
		         {%- if item.urlfor == "source" -%}
		   {{ url_for(item.urlfor, page=navigation.page) }}
		   {%- else -%}
		   {{ url_for(item.urlfor) }}
		   {%- endif -%}
		   {%- else -%}
		   {{ url_for('staticpage', page=item.base) }}
		   {%- endif -%}
		   
		   {%- if item.rel -%}
		   " rel="{{item.rel}} 
		         {%- endif -%}
		         ">{{item.link_text}}</a></li>
	    {% endfor -%}
	  </ul>
	  <p>
	    <a href="/rss" >
	      <img src="/static/imgs/rss.png" width="24" heigth="24">
	      RSS
	    </a>
	  </p>
        </div>

	<!-- Noticias Realcionadas si es un post -->
        <div id="noticias_relacionadas_bottom">
	  {% if contexto is defined %}
	    {% if contexto['relacionadas'] is defined %}
	      <h3>Posts/Noticias relacionadas</h3>
	      {% for post_relacionado in contexto['relacionadas'] %}
	        <p>
	          <a href="/posts/{{ post_relacionado }}">
	            {{ post_relacionado|n_heading }}
	          </a>
	        </p>
	        <hr>
	      {% endfor %}
	    {% endif %}
	  {% endif %}
        </div>
        <!-- consejo del dia -->
	<div id="consejo_del_dia_bottom">
	  <b>Consejo del día</b>
	  <hr>
	  {% if contexto %}
	    {{ contexto['consejo']|safe }}
	  {% endif %}
	</div>

      </div>

    </div> <!-- row -->




  </div>

  <div id="footer">
    <p id="footer">
      Este sitio web es software libre aquí el <a href="https://notabug.org/strysg/monimatapa">código fuente</a>.<br>
      El contenido de este sitio esta bajo una licencia Creative Commons <a href="https://creativecommons.org/licenses/by/4.0/">Attribution 4.0 International (CC BY 4.0)</a> a menos que se indique lo contrario.
      <!-- footer goes here -->
      {% if footer %}
      {{footer}}
      {% endif %}

    </p>
  </div>

  <!-- javascript -->
  <script language="javascript">
   function loadCssStyle() {
     const _varStyleName = 'style_css';
     var lsStyle = window.localStorage.getItem(_varStyleName);
     if (!lsStyle) {
       // default
       window.localStorage.setItem('style_css', 'oscuro');
       lsStyle = window.localStorage.getItem(_varStyleName);
     }
     var i, link_tag = document.getElementsByTagName("link");
     // inspeccionando hojas de estilo css cargadas
     for (
       i = 0, 
       link_tag = document.getElementsByTagName("link") ; i < link_tag.length ;
       i++ ) {
       if ((link_tag[i].rel.indexOf( "stylesheet" ) != -1)) {
         link_tag[i].disabled = true;
         if (link_tag[i].title === lsStyle) {
	   link_tag[i].disabled = false ;
           console.log('enabling', link_tag[i].title);
         }
       }
     }
   }
   
   function cambiarEstilo(value) {
     window.localStorage.setItem('style_css', value);
     loadCssStyle();
   }
  </script>
  <!-- --->

</body>
</html>
